<%@ page language="java" contentType="text/html; charset=utf-8"
    pageEncoding="utf-8"%>
    <%@ taglib prefix="s" uri="/struts-tags" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<link rel="stylesheet" type="text/css" href="<s:url value='/resources/css/shop/payAccount.css'/>" media="all" />
<script type="text/javascript" src="<s:url value='/resources/js/jquery/jquery-1.5.2.min.js'/>"></script> 
<style type="text/css">
	
</style>
<script type="text/javascript">
	var contextpath= "<%=request.getContextPath()%>";
	var tnterval;
	function print(){
		
		var html='<iframe id="printIframe" frameborder="0" scrolling="no" src="'+contextpath+'/shop/queryPayAccount.do?orderid='+'<s:property value="payAccount.orderid" />'+'"></iframe>';
		$("#printIframe").remove();
		$(".menu").append(html);
		$(".loading").show();
		$("#printIframe").bind('load',function(){
			$("#printIframe").hide();
			$(".loading").hide();
			$(".success").show();
			
			var i=4;
			if(tnterval!=null){
				clearInterval(tnterval);
			}
			tnterval=setInterval(function(){
				if(i>0){
					$(".time").text(i);
					i--;
				}
			}, 1000);
			time=setTimeout(function(){
				clearInterval(tnterval);
				window.parent.location.href=contextpath+"/shop/intoShop.do?placeid="+<s:property value="payAccount.shopPlan.placeid" />;
			}, 5000); 
		});
	}
</script>
</head>
<body>
<div class="content">
	<div class="headText">付款</div>
	<div >
		<div class="guideText">
			<div style="float: left;width: 190px;">
				<span>旅行社：</span><span><s:property value="payAccount.shopPlan.agencyName" /></span>
			</div>
			<div style="float: left;margin-left: 77px">
				<span>旅行团：</span><span><s:property value="payAccount.shopPlan.groupName" /></span>
			</div>
			<div class="clr"></div>
			<div style="float: left;width: 190px;">
				<span>导游：</span><span><s:property value="payAccount.shopPlan.guideName" /></span>
			</div>
			<div style="float: left;margin-left: 77px">
				<span>购物场所：</span><span><s:property value="payAccount.shopPlan.placeName" /></span>
			</div>
			<div class="clr"></div>
		</div>
		<div class="goodsList">
			<table >
				<thead>
					<tr>
						<td>商品名称</td>
						<td>单价</td>
						<td>数量</td>
					</tr>
				</thead>
				<tbody id="goods">
				<s:iterator value="payAccount.goodsList">
					<tr>
						<td><s:property value="name" /></td>
						<td><s:property value="price" /></td>
						<td><s:property value="num" /></td>
					</tr>
				</s:iterator>
				</tbody>
			</table>
		</div>
		<div class="total">
			<span>总计：</span>
			<span><s:property value="payAccount.total" /></span>
		</div>
		<div class="clr"></div>
	</div>
	<div class="menu">
		<div class="print">
			<button class="bt printbt" type="button" onclick="print()"></button>
		</div>
		
		<div class="clr"></div>
	</div>
	<div class="success">
		<div class="success_icon"><img alt="" src="<s:url value="/resources/images/shop/guide/success.png" />"></div>
		<div class="success_text" style="">购买成功</div>
		<div class="clr"></div>
		<div class="time">5</div>
		<div class="clr"></div>
	</div>
	<div class="loading">
		<div class="loading_icon"><img alt="" src="<s:url value="/resources/images/shop/shopping/loading.gif" />"></div>
		<div class="loading_text" style="">正在打印</div>
		<div class="clr"></div>
	</div>
</div>
</body>
</html>